package com.cqhfan.chatroom.controller;

import com.cqhfan.chatroom.domain.vo.UserAndGroupSearchVO;
import com.cqhfan.chatroom.service.ISearchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 眭传洪
 * @create 2024-11-20 20:14
 */
@Tag(name = "搜索相关")
@RestController
@RequestMapping("/search")
@RequiredArgsConstructor
public class SearchController {

    private final ISearchService searchService;

    @Operation(summary = "搜索接口")
    @GetMapping("/searchUserAndGroup")
    public UserAndGroupSearchVO searchUserAndGroup(@RequestParam("key") String key) {
        return searchService.searchUserAndGroup(key);
    }

}
